<% remote_form_for @user,
     :url => bind_fetion_user_url(@user),
     :method => :put,    
     :loading => small_loading("verify_#{@user.id}", :height => '20px'), 
     :failure => "$('verify_#{@user.id}').update(request.responseText)", 
     :success => "$('user_#{@user.id}').update(request.responseText)",    
     :html => {
       :id => "#{@user.id}_bind_fetion_form"
     } do |f|
 %> 
  <dl>
    <dt>验证码：</dt>
    <dd><%= text_field_tag 'verify_code','', :id =>"fetion_#{@fetion_robot.id}_code" %></dd>
    <dd>
      <%= hidden_field_tag 'session_id',@lite_fetion['session_id'] %>
      <%= hidden_field_tag 'fetion_id', @fetion_robot.id %>
      <img src="data:image/gif;base64,<%= @verify ? @verify['data'] : @lite_fetion['data'] %>">
    </dd>
  </dl>    
  <dl>
    <dt>手机号：</dt>
    <dd><%= text_field_tag 'dist_mobile',@user.mobile %></dd>
  </dl>    
  <dl>    
    <dd class="right">
      <%= link_to_function '添加', "$('#{@user.id}_bind_fetion_form').onsubmit()", :class => :submit %>
      <%= link_to_function '看不清，换一张', 
            "$('fetion_verify_#{@user.id}').onclick()",
            :class => :reset %> 
    </dd>
  </dl>
<% end %>
<script type="text/javascript" charset="utf-8">
  <% if @error.present? %>
  alert("<%= t @error %>导致绑定失败，请重试");
  <% end %>
</script>